﻿
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Modularity;

namespace WebApplication1
{
    [DependsOn(typeof(AbpAspNetCoreMvcModule ))]
    public class AppModule:AbpModule
    {
        //ABp中的中间件管道配置不在Startup中配置 转移到appmodule OnApplicationInitialization这个方法通常用来配置管道
        public override void OnApplicationInitialization(ApplicationInitializationContext context)
        {
            var app = context.GetApplicationBuilder();
            var env = context.GetEnvironment();
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseRouting();

            app.UseAuthorization();

            app.UseConfiguredEndpoints();
        }
    }
}
